<%@ include file="config.jsp" %>

<html>
<head>
<title>CURSO</title>
</head>
    <body>
    	<div id="header">
			<%@ include file="header.jsp" %>
    	</div>	  
    	<div id="menu">
			<%@ include file="menu.jsp" %>
    	</div>	  
    	<div id="body">
    	<div class=error>
    		<ul>
		   		<c:forEach var="error" items="${errors}" > 
					<li>${error}</li>		   			
		   		</c:forEach>
    		</ul>
    	
    	
    	</div>
		<div class=message>${message}</div>
			<fieldset>
				<legend>Cadastro de Curso</legend>
				<form method="post" name="usuarioSistema" action="${pageContext.request.contextPath}/cursoSalvar">
					<label>Nome do curso</label>
					<input type="text" name="nomeCurso" size="30" maxlength="50">
					
					<label>Data criacao</label>
					<input type="text" name="dataCriacao"  title="Ex. 21/11/2009" alt="Ex. 21/11/2009" size="10" maxlength="10">
					
					<label>Data autorizacao</label>
					<input type="text" name=dataAutorizacao title="Ex. 21/11/2009" alt="Ex. 21/11/2009" size="10" maxlength="10">
					
					<label>Data reconhecimento</label>
					<input type="text" name="dataReconhecimento" title="Ex. 21/11/2009" alt="Ex. 21/11/2009" size="10" maxlength="10">
					
					<label>Carga horaria</label>
					<input type="text" name="cargaHoraria" size="4" maxlength="4">
					
					<input type="submit" value="gravar">
				</form>
			</fieldset>
			<div id="result">
					<table>
						<thead>
							<tr>
							
								<td>Codigo Curso</td>
								<td>Nome Curso</td>
								<td>Data Criacao</td>
								<td>Data Autoriazcao</td>
								<td>Data Reconhecimento</td>
								<td>Carga Horaria</td>
								<td>Situacao</td>
								<td>Editar</td>
							</tr>
						</thead>
						<tbody>
					<c:forEach var="curso" items="${cursos}" > 
							<tr>
								<td>${curso.codigoCurso}</td>
								<td>${curso.nomeCurso}</td>
								<td><fmt:formatDate value="${curso.dataCriacao}" pattern="dd/MM/yyyy"/></td>
								<td><fmt:formatDate value="${curso.dataAutorizacao}" pattern="dd/MM/yyyy"/> </td>
								<td><fmt:formatDate value="${curso.dataReconhecimento}" pattern="dd/MM/yyyy"/> </td>
								<td>${curso.cargaHoraria}</td>
								<td>${curso.situacaoCurso}</td>
								<td><a href="${pageContext.request.contextPath}/editarcurso?codigoCurso=${curso.codigoCurso}">Editar</a></td>
							</tr>
					</c:forEach>
						</tbody>
					</table>
				</div>
			
    	</div>	  
    	<div id="footer">
			<%@ include file="footer.jsp" %>
    	</div>	  
		      
    </body>  
</html>